﻿using System;
using System.Collections.Generic;
using huqiang;
using huqiang.Core.UIData;
using huqiang.Data;
using huqiang.UIEvent;
using huqiang.UIModel;
using UnityEngine;

namespace huqiang.Helper.HGUI
{
    /// <summary>
    /// ui画布
    /// </summary>
    public class HCanvas: UIContext
    {
        [SerializeField]
        public huqiang.Core.HGUI.HCanvas Content;
        [SerializeField]
        [HideInInspector]
        public int ContextID;
        public void Awake()
        {
            if (Content == null)
                Content = new Core.HGUI.HCanvas();
            ContextID = Content.GetInstanceID();
        }
#if UNITY_EDITOR
        public TextAsset NewBytesUI;
        public TextAsset OldBytesUI;
        public string AssetName = "baseUI";
        public string dicpath;
        public string CloneName;

        public override Core.HGUI.UIElement GetUIData()
        {
            if (Content == null)
                Content = new Core.HGUI.HCanvas();
            return Content;
        }
        public void OnDestroy()
        {
            if (Content != null)
                Content.Dispose();
        }
#endif
    }
}
